<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Financing extends Model {

	//
	protected $table = "financing";
	protected $fillable = ['related_id', 'type', 'canbe_report_file', 'prove_report_file', 'gov_agreement_file', 'non_financial_name', 'non_financial_content'];

	public function finIncome()
	{
		return $this->hasOne("App\Models\FinancialIncoming", "financing_id", "id");
	}

	public function liability()
	{
		return $this->hasOne("App\Models\Liability", "financing_id", "id");
	}

	public function cashFlow()
	{
		return $this->hasOne("App\Models\CashFlow", "financing_id", "id");
	}

	public function project()
	{
		return $this->hasOne("App\Models\Projects", "id", "related_id");
	}

	public function device()
	{
		return $this->hasOne("App\Models\Devices", "id", "related_id");
	}

	public function tech()
	{
		return $this->hasOne("App\Models\Technologies", "id", "related_id");
	}


}
